<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenShoe: USB Device Controller (UDC)</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenShoe
   &#160;<span id="projectnumber">0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#groups">Modules</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">USB Device Controller (UDC)</div>  </div>
<div class="ingroups"><a class="el" href="group__usb__device__group.html">USB Stack Devices</a></div></div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structudc__string__desc__t.html">udc_string_desc_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">USB device string descriptor Structure used to transfer ASCII strings to USB String descriptor structure.  <a href="structudc__string__desc__t.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="groups"></a>
Modules</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udc__desc__group.html">USB Device Descriptor</a></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structusb__iface__desc__t.html">usb_iface_desc_t</a> UDC_DESC_STORAGE *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udc__group.html#ga7da79665b18d9c63db481ec59987ce66">udc_get_interface_desc</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a pointer on the current interface descriptor.  <a href="#ga7da79665b18d9c63db481ec59987ce66"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udc__group.html#ga11a32ff7928ba06d3b59e95e0a2b7a92">udc_reset</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset the current configuration of the USB device, This routines can be called by UDD when a RESET on the USB line occurs.  <a href="#ga11a32ff7928ba06d3b59e95e0a2b7a92"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udc__group.html#ga4afae313045f44b5eb4c60957ab8ef4e">udc_sof_notify</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">To signal that a SOF is occured.  <a href="#ga4afae313045f44b5eb4c60957ab8ef4e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udc__group.html#ga58c2916d7984e0e5b2143cadf4af6080">udc_process_setup</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Main routine to manage the USB SETUP request.  <a href="#ga58c2916d7984e0e5b2143cadf4af6080"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
Internal structure to store the USB device main strings</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udc__group.html#gac2dafd8d9efe73f2709291818829a79b">USB_DEVICE_MANUFACTURE_NAME_SIZE</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">USB device manufacture name storage String is allocated only if USB_DEVICE_MANUFACTURE_NAME is declared by usb application configuration.  <a href="#gac2dafd8d9efe73f2709291818829a79b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udc__group.html#ga76a9e0f1f322165feaf0a8f2f583ea8f">USB_DEVICE_PRODUCT_NAME_SIZE</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">USB device product name storage String is allocated only if USB_DEVICE_PRODUCT_NAME is declared by usb application configuration.  <a href="#ga76a9e0f1f322165feaf0a8f2f583ea8f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__udc__group.html#gacf4c1ef7c6001ee2b919e81143543899">USB_DEVICE_SERIAL_NAME_SIZE</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get USB device serial number.  <a href="#gacf4c1ef7c6001ee2b919e81143543899"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>The UDC provides a high-level abstraction of the usb device. You can use these functions to control the main device state (start/attach/wakeup).</p>
<h2><a class="anchor" id="USB_DEVICE_CONF"></a>
USB Device Custom configuration</h2>
<p>The following USB Device configuration must be included in the <a class="el" href="conf__usb_8h.html" title="USB configuration file for CDC application.">conf_usb.h</a> file of the application.</p>
<p>USB_DEVICE_VENDOR_ID (Word)<br/>
 Vendor ID provided by USB org (ATMEL 0x03EB).</p>
<p>USB_DEVICE_PRODUCT_ID (Word)<br/>
 Product ID (Referenced in <a class="el" href="usb__atmel_8h.html" title="All USB VIDs and PIDs from Atmel AVR applications.">usb_atmel.h</a>).</p>
<p>USB_DEVICE_MAJOR_VERSION (Byte)<br/>
 Major version of the device</p>
<p>USB_DEVICE_MINOR_VERSION (Byte)<br/>
 Minor version of the device</p>
<p>USB_DEVICE_MANUFACTURE_NAME (string)<br/>
 ASCII name for the manufacture</p>
<p>USB_DEVICE_PRODUCT_NAME (string)<br/>
 ASCII name for the product</p>
<p>USB_DEVICE_SERIAL_NAME (string)<br/>
 ASCII name to enable and set a serial number</p>
<p>USB_DEVICE_POWER (Numeric)<br/>
 (unit mA) Maximum device power</p>
<p>USB_DEVICE_ATTR (Byte)<br/>
 USB attributes available:</p>
<ul>
<li>USB_CONFIG_ATTR_SELF_POWERED</li>
<li>USB_CONFIG_ATTR_REMOTE_WAKEUP Note: if remote wake enabled then defines remotewakeup callbacks, see Table 5-2. External API from UDC - Callback</li>
</ul>
<p>USB_DEVICE_LOW_SPEED (Only defined)<br/>
 Force the USB Device to run in low speed</p>
<p>USB_DEVICE_HS_SUPPORT (Only defined)<br/>
 Authorize the USB Device to run in high speed</p>
<p>USB_DEVICE_MAX_EP (Byte)<br/>
 Define the maximum endpoint number used by the USB Device.<br/>
 This one is already defined in UDI default configuration. Ex:</p>
<ul>
<li>When endpoint control 0x00, endpoint 0x01 and endpoint 0x82 is used then USB_DEVICE_MAX_EP=2</li>
<li>When only endpoint control 0x00 is used then USB_DEVICE_MAX_EP=0</li>
<li>When endpoint 0x01 and endpoint 0x81 is used then USB_DEVICE_MAX_EP=1<br/>
 (configuration not possible on USBB interface) </li>
</ul>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gac2dafd8d9efe73f2709291818829a79b"></a><!-- doxytag: member="udc.c::USB_DEVICE_MANUFACTURE_NAME_SIZE" ref="gac2dafd8d9efe73f2709291818829a79b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define USB_DEVICE_MANUFACTURE_NAME_SIZE&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>USB device manufacture name storage String is allocated only if USB_DEVICE_MANUFACTURE_NAME is declared by usb application configuration. </p>

</div>
</div>
<a class="anchor" id="ga76a9e0f1f322165feaf0a8f2f583ea8f"></a><!-- doxytag: member="udc.c::USB_DEVICE_PRODUCT_NAME_SIZE" ref="ga76a9e0f1f322165feaf0a8f2f583ea8f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define USB_DEVICE_PRODUCT_NAME_SIZE&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>USB device product name storage String is allocated only if USB_DEVICE_PRODUCT_NAME is declared by usb application configuration. </p>

</div>
</div>
<a class="anchor" id="gacf4c1ef7c6001ee2b919e81143543899"></a><!-- doxytag: member="udc.c::USB_DEVICE_SERIAL_NAME_SIZE" ref="gacf4c1ef7c6001ee2b919e81143543899" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define USB_DEVICE_SERIAL_NAME_SIZE&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get USB device serial number. </p>
<p>Use the define USB_DEVICE_SERIAL_NAME to set static serial number.</p>
<p>For dynamic serial number set the define USB_DEVICE_GET_SERIAL_NAME_POINTER to a suitable pointer. This will also require the serial number length define USB_DEVICE_GET_SERIAL_NAME_LENGTH. </p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga7da79665b18d9c63db481ec59987ce66"></a><!-- doxytag: member="udc.c::udc_get_interface_desc" ref="ga7da79665b18d9c63db481ec59987ce66" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structusb__iface__desc__t.html">usb_iface_desc_t</a> UDC_DESC_STORAGE * udc_get_interface_desc </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns a pointer on the current interface descriptor. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>pointer on the current interface descriptor. </dd></dl>

</div>
</div>
<a class="anchor" id="ga58c2916d7984e0e5b2143cadf4af6080"></a><!-- doxytag: member="udc.c::udc_process_setup" ref="ga58c2916d7984e0e5b2143cadf4af6080" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool udc_process_setup </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Main routine to manage the USB SETUP request. </p>
<p>Decodes and manages a setup request.</p>
<p>This function parses a USB SETUP request and submits an appropriate response back to the host or, in the case of SETUP OUT requests with data, sets up a buffer for receiving the data payload.</p>
<p>The main standard requests defined by the USB 2.0 standard are handled internally. The interface requests are sent to UDI, and the specific request sent to a specific application callback.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the request is supported, else the request is stalled by UDD </dd></dl>

</div>
</div>
<a class="anchor" id="ga11a32ff7928ba06d3b59e95e0a2b7a92"></a><!-- doxytag: member="udc.c::udc_reset" ref="ga11a32ff7928ba06d3b59e95e0a2b7a92" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void udc_reset </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reset the current configuration of the USB device, This routines can be called by UDD when a RESET on the USB line occurs. </p>
<p>Reset the UDC. </p>

</div>
</div>
<a class="anchor" id="ga4afae313045f44b5eb4c60957ab8ef4e"></a><!-- doxytag: member="udc.c::udc_sof_notify" ref="ga4afae313045f44b5eb4c60957ab8ef4e" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void udc_sof_notify </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>To signal that a SOF is occured. </p>
<p>The UDC must send the signal to all UDIs enabled </p>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Mon Dec 19 2011 21:04:54 for OpenShoe by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
